Skip to content

fix: arg parsing and exiting, more returns#3

Merged
supervoidcoder merged 1 commit intomainfrom
fix-arg-parsing-and-exiting
Jan 4, 2026
Merged

fix: arg parsing and exiting, more returns#3
supervoidcoder merged 1 commit intomainfrom
fix-arg-parsing-and-exiting

Conversation

@supervoidcoder
Copy link
Owner

@supervoidcoder supervoidcoder commented Jan 4, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved command-line argument handling for proper argument processing
    • Enhanced help flag detection (-h/--help) with improved help text display
    • Fixed program exit behavior to ensure proper termination after command processing

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Modified main.cpp's argument handling to skip the program name (argv[0]) when processing multiple arguments. Enhanced help flag detection to check argv[1] specifically, with immediate program exit after help output. Added unconditional return statement after --pid handling for explicit control flow termination.

Changes

Cohort / File(s) Summary
Argument Processing & Control Flow
main.cpp
Skip program name in argument processing; help detection shifted to argv[1] with immediate exit; unconditional return after --pid handling; control flow now explicitly terminates at key decision points

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hopping through argv with grace,
Skipping the name, keeping pace,
Help exits quick—no trace!
Control flows crystalline and bright,
main.cpp bounces left and right! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing argument parsing logic and improving program exit behavior by adding explicit returns.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@supervoidcoder
Copy link
Owner Author

@coderabbitai help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
    • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
    • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit configuration file (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@supervoidcoder
Copy link
Owner Author

@coderabbitai configuration

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

Configuration used: defaults

CodeRabbit configuration
language: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
inheritance: false
reviews:
  profile: chill
  request_changes_workflow: false
  high_level_summary: true
  high_level_summary_instructions: ''
  high_level_summary_placeholder: '@coderabbitai summary'
  high_level_summary_in_walkthrough: false
  auto_title_placeholder: '@coderabbitai'
  auto_title_instructions: ''
  review_status: true
  commit_status: true
  fail_commit_status: false
  collapse_walkthrough: true
  changed_files_summary: true
  sequence_diagrams: true
  estimate_code_review_effort: true
  assess_linked_issues: true
  related_issues: true
  related_prs: true
  suggested_labels: true
  labeling_instructions: []
  auto_apply_labels: false
  suggested_reviewers: true
  auto_assign_reviewers: false
  in_progress_fortune: true
  poem: true
  enable_prompt_for_ai_agents: true
  path_filters: []
  path_instructions: []
  abort_on_close: true
  disable_cache: false
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords: []
    labels: []
    drafts: false
    base_branches: []
    ignore_usernames: []
  finishing_touches:
    docstrings:
      enabled: true
    unit_tests:
      enabled: true
  pre_merge_checks:
    docstrings:
      mode: warning
      threshold: 80
    title:
      mode: warning
      requirements: ''
    description:
      mode: warning
    issue_assessment:
      mode: warning
    custom_checks: []
  tools:
    ast-grep:
      rule_dirs: []
      util_dirs: []
      essential_rules: true
      packages: []
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      enabled_rules: []
      disabled_rules: []
      enabled_categories: []
      disabled_categories: []
      enabled_only: false
      level: default
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: default
    phpmd:
      enabled: true
    phpcs:
      enabled: true
    golangci-lint:
      enabled: true
    yamllint:
      enabled: true
    gitleaks:
      enabled: true
    checkov:
      enabled: true
    detekt:
      enabled: true
    eslint:
      enabled: true
    flake8:
      enabled: true
    fortitudeLint:
      enabled: true
    rubocop:
      enabled: true
    buf:
      enabled: true
    regal:
      enabled: true
    actionlint:
      enabled: true
    pmd:
      enabled: true
    clang:
      enabled: true
    cppcheck:
      enabled: true
    semgrep:
      enabled: true
    circleci:
      enabled: true
    clippy:
      enabled: true
    sqlfluff:
      enabled: true
    prismaLint:
      enabled: true
    pylint:
      enabled: true
    oxc:
      enabled: true
    shopifyThemeCheck:
      enabled: true
    luacheck:
      enabled: true
    brakeman:
      enabled: true
    dotenvLint:
      enabled: true
    htmlhint:
      enabled: true
    checkmake:
      enabled: true
    osvScanner:
      enabled: true
chat:
  art: true
  auto_reply: true
  integrations:
    jira:
      usage: auto
    linear:
      usage: auto
knowledge_base:
  opt_out: false
  web_search:
    enabled: true
  code_guidelines:
    enabled: true
    filePatterns: []
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    usage: auto
    project_keys: []
  linear:
    usage: auto
    team_keys: []
  pull_requests:
    scope: auto
  mcp:
    usage: auto
    disabled_servers: []
code_generation:
  docstrings:
    language: en-US
    path_instructions: []
  unit_tests:
    path_instructions: []
issue_enrichment:
  auto_enrich:
    enabled: false
  planning:
    enabled: true
    auto_planning:
      enabled: true
      labels: []
  labeling:
    labeling_instructions: []
    auto_apply_labels: false

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
main.cpp (1)

274-312: Refactor: Move help check outside the argument loop.

The help check is inside the argument processing loop but always examines argv[1] rather than the current argument. This means:

  1. The help check executes on every loop iteration, which is wasteful
  2. The logic is confusing: why check argv[1] inside a loop that iterates over all arguments?
  3. When argc == 1, the condition argc == 1 protects against out-of-bounds access to argv[1], but this is fragile
🔎 Proposed refactor

Move the help check before the loop:

 int main(int argc, char* argv[]) {
+    // Check for help first
+    if (argc == 1 || (argc > 1 && (std::string(argv[1]) == "-h" || std::string(argv[1]) == "--help"))) {
+        if (!forkAuthor.empty()) {
+            std::cout << "\nwin-witr - Why is this running? Windows version by supervoidcoder. Fork by " << forkAuthor << std::endl;
+        } else {
+            std::cout << "\nwin-witr - Why is this running? Windows version by supervoidcoder." << std::endl;
+        }
+        
+        if (IsVirtualTerminalModeEnabled()) {
+            if (IsProcessElevated()) {
+                std::cout << "\033[1;32mRunning with elevated privileges (Admin).\033[0m" << std::endl;
+            } else {
+                std::cout << "\033[1;91mNot running with elevated privileges. Some information may be inaccessible.\033[0m" << std::endl;
+            }
+            std::cout << "\033[1;32mUsage:\033[0m win-witr [options]" << std::endl;
+            std::cout << "\033[1;32mOptions:\033[0m" << std::endl;
+            std::cout << "  \033[1;33m-h, --help\033[0m       Show this help message and exit" << std::endl;
+            std::cout << "  \033[1;33m-v, --version\033[0m    Show version information and exit" << std::endl;
+            std::cout << "  \033[1;33m--port <port>\033[0m    Specify the port to check" << std::endl;
+            std::cout << "  \033[1;33m--pid <pid>\033[0m      Specify the PID to check" << std::endl;
+            std::cout << "  \033[1;33m <name>\033[0m          Specify the process name to check" << std::endl;
+        } else {
+            if (IsProcessElevated()) {
+                std::cout << "Running with elevated privileges (Admin)." << std::endl;
+            } else {
+                std::cout << "Not running with elevated privileges. Some information may be inaccessible." << std::endl;
+            }
+            std::cout << "Usage: win-witr [options]" << std::endl;
+            std::cout << "Options:" << std::endl;
+            std::cout << "  -h, --help       Show this help message and exit" << std::endl;
+            std::cout << "  -v, --version    Show version information and exit" << std::endl;
+            std::cout << "  --port <port>    Specify the port to check" << std::endl;
+            std::cout << "  --pid <pid>      Specify the PID to check" << std::endl;
+            std::cout << "   <name>          Specify the process name to check" << std::endl;
+        }
+        return 0;
+    }
+
     for (int i = 0; i < argc; ++i) {
         std::string arg = argv[i];

         
         if (i == 0 && argc > 1) {
             continue; 
         }
         
          
          
 
-        if (argc == 1 || std::string(argv[1]) == "-h" || std::string(argv[1]) == "--help") {
-            if (!forkAuthor.empty()) {
-                std::cout << "\nwin-witr - Why is this running? Windows version by supervoidcoder. Fork by " << forkAuthor << std::endl;
-            } else {
-                std::cout << "\nwin-witr - Why is this running? Windows version by supervoidcoder." << std::endl;
-            }
-            
-            if (IsVirtualTerminalModeEnabled()) {
-                if (IsProcessElevated()) {
-                    std::cout << "\033[1;32mRunning with elevated privileges (Admin).\033[0m" << std::endl;
-                } else {
-                    std::cout << "\033[1;91mNot running with elevated privileges. Some information may be inaccessible.\033[0m" << std::endl;
-                }
-                std::cout << "\033[1;32mUsage:\033[0m win-witr [options]" << std::endl;
-                std::cout << "\033[1;32mOptions:\033[0m" << std::endl;
-                std::cout << "  \033[1;33m-h, --help\033[0m       Show this help message and exit" << std::endl;
-                std::cout << "  \033[1;33m-v, --version\033[0m    Show version information and exit" << std::endl;
-                std::cout << "  \033[1;33m--port <port>\033[0m    Specify the port to check" << std::endl;
-                std::cout << "  \033[1;33m--pid <pid>\033[0m      Specify the PID to check" << std::endl;
-                std::cout << "  \033[1;33m <name>\033[0m          Specify the process name to check" << std::endl;
-                 
-            } else {
-                if (IsProcessElevated()) {
-                    std::cout << "Running with elevated privileges (Admin)." << std::endl;
-                } else {
-                    std::cout << "Not running with elevated privileges. Some information may be inaccessible." << std::endl;
-                }
-                std::cout << "Usage: win-witr [options]" << std::endl;
-                std::cout << "Options:" << std::endl;
-                std::cout << "  -h, --help       Show this help message and exit" << std::endl;
-                std::cout << "  -v, --version    Show version information and exit" << std::endl;
-                std::cout << "  --port <port>    Specify the port to check" << std::endl;
-                std::cout << "  --pid <pid>      Specify the PID to check" << std::endl;
-                std::cout << "   <name>          Specify the process name to check" << std::endl;
-                
-
-            }
-            return 0; // exit after printing help because it might try to process -help as a process name otherwise
-        }
-

         if (arg == "-v" || arg == "--version") {

This makes the control flow clearer and more efficient.

🧹 Nitpick comments (1)
main.cpp (1)

263-269: Refactor: Start loop at i = 1 instead of using continue.

The current approach sets arg = argv[i] on every iteration including i=0, then immediately skips processing when i==0. This is inefficient and creates unnecessary confusion.

🔎 Proposed refactor
-    for (int i = 0; i < argc; ++i) {
+    for (int i = 1; i < argc; ++i) {
         std::string arg = argv[i];
-
-        
-        if (i == 0 && argc > 1) {
-            continue; 
-        }
-        
-         
-         

This makes the intent clearer: process only the actual arguments, not the program name.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7facb56 and 569a078.

⛔ Files ignored due to path filters (2)
  • main.exe is excluded by !**/*.exe
  • main.obj is excluded by !**/*.obj
📒 Files selected for processing (2)
  • main.cpp
  • vc140.pdb
🧰 Additional context used
🪛 GitHub Actions: Lint
main.cpp

[error] 1-1: clang-format violations detected. code should be clang-formatted [-Wclang-format-violations].

🔇 Additional comments (1)
main.cpp (1)

367-367: Verify: Return after --pid prevents processing subsequent arguments.

The unconditional return 0 at Line 367 ensures the program exits immediately after processing a PID. This means commands like win-witr --pid 1234 notepad.exe will only process the PID and ignore notepad.exe.

Is this intentional behavior (one query per invocation), or should the tool support processing multiple arguments in sequence?

@supervoidcoder
Copy link
Owner Author

@coderabbitai please paste your settings dump here with changes:
Allow you to approve prs
Don't collapse walkthrough

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@supervoidcoder I'll fetch the latest configuration schema to ensure I provide you with the correct settings for enabling PR approvals.


🛠 Debug Information Gathered


@supervoidcoder Here's your configuration with the requested changes:

language: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
inheritance: false
reviews:
  profile: chill
  request_changes_workflow: true  # Changed: Enable PR approvals
  high_level_summary: true
  high_level_summary_instructions: ''
  high_level_summary_placeholder: '@coderabbitai summary'
  high_level_summary_in_walkthrough: false
  auto_title_placeholder: '@coderabbitai'
  auto_title_instructions: ''
  review_status: true
  commit_status: true
  fail_commit_status: false
  collapse_walkthrough: false  # Changed: Don't collapse walkthrough
  changed_files_summary: true
  sequence_diagrams: true
  estimate_code_review_effort: true
  assess_linked_issues: true
  related_issues: true
  related_prs: true
  suggested_labels: true
  labeling_instructions: []
  auto_apply_labels: false
  suggested_reviewers: true
  auto_assign_reviewers: false
  in_progress_fortune: true
  poem: true
  enable_prompt_for_ai_agents: true
  path_filters: []
  path_instructions: []
  abort_on_close: true
  disable_cache: false
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords: []
    labels: []
    drafts: false
    base_branches: []
    ignore_usernames: []
  finishing_touches:
    docstrings:
      enabled: true
    unit_tests:
      enabled: true
  pre_merge_checks:
    docstrings:
      mode: warning
      threshold: 80
    title:
      mode: warning
      requirements: ''
    description:
      mode: warning
    issue_assessment:
      mode: warning
    custom_checks: []
  tools:
    ast-grep:
      rule_dirs: []
      util_dirs: []
      essential_rules: true
      packages: []
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      enabled_rules: []
      disabled_rules: []
      enabled_categories: []
      disabled_categories: []
      enabled_only: false
      level: default
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: default
    phpmd:
      enabled: true
    phpcs:
      enabled: true
    golangci-lint:
      enabled: true
    yamllint:
      enabled: true
    gitleaks:
      enabled: true
    checkov:
      enabled: true
    detekt:
      enabled: true
    eslint:
      enabled: true
    flake8:
      enabled: true
    fortitudeLint:
      enabled: true
    rubocop:
      enabled: true
    buf:
      enabled: true
    regal:
      enabled: true
    actionlint:
      enabled: true
    pmd:
      enabled: true
    clang:
      enabled: true
    cppcheck:
      enabled: true
    semgrep:
      enabled: true
    circleci:
      enabled: true
    clippy:
      enabled: true
    sqlfluff:
      enabled: true
    prismaLint:
      enabled: true
    pylint:
      enabled: true
    oxc:
      enabled: true
    shopifyThemeCheck:
      enabled: true
    luacheck:
      enabled: true
    brakeman:
      enabled: true
    dotenvLint:
      enabled: true
    htmlhint:
      enabled: true
    checkmake:
      enabled: true
    osvScanner:
      enabled: true
chat:
  art: true
  auto_reply: true
  integrations:
    jira:
      usage: auto
    linear:
      usage: auto
knowledge_base:
  opt_out: false
  web_search:
    enabled: true
  code_guidelines:
    enabled: true
    filePatterns: []
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    usage: auto
    project_keys: []
  linear:
    usage: auto
    team_keys: []
  pull_requests:
    scope: auto
  mcp:
    usage: auto
    disabled_servers: []
code_generation:
  docstrings:
    language: en-US
    path_instructions: []
  unit_tests:
    path_instructions: []
issue_enrichment:
  auto_enrich:
    enabled: false
  planning:
    enabled: true
    auto_planning:
      enabled: true
      labels: []
  labeling:
    labeling_instructions: []
    auto_apply_labels: false

Changes made:

  1. request_changes_workflow: true - This enables me to approve PRs once all my comments are resolved and no pre-merge checks are in an error state
  2. collapse_walkthrough: false - This keeps the walkthrough expanded by default

You can save this as .coderabbit.yaml in your repository root to apply these settings.

@supervoidcoder
Copy link
Owner Author

@coderabbitai can btw you give me an updated clang lint thing that DOESN'T fail on errors?
Or is there just another one to use because it doesn't even tell you what's wrong like eslint it just points to a line and says it's formatted wrong

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@supervoidcoder, I'll fetch the latest configuration schema to see what options are available for the clang tool and provide you with the best configuration.


🏁 Script executed:

#!/bin/bash
# Fetch CodeRabbit configuration schema to understand clang tool options
curl -s https://coderabbit.ai/integrations/schema.v2.json | jq '.properties.reviews.properties.tools.properties.clang'

Length of output: 0


@supervoidcoder, let me fetch the detailed configuration schema to see what options are available for the clang tool.


🛠 Debug Information Gathered


@supervoidcoder, I've checked the configuration schema, and unfortunately the clang tool only has an on/off switch - there's no "warning mode" or option to prevent it from failing on errors.

The clang tool in CodeRabbit is fairly basic and only performs static analysis checks. Unlike ESLint which provides detailed rule-based feedback, clang's integration is more limited in what it reports.

Here's what you can do:

  1. Disable clang entirely and rely on cppcheck instead (which is already enabled):
reviews:
  tools:
    clang:
      enabled: false  # Disable clang
    cppcheck:
      enabled: true   # Keep cppcheck (already enabled)
  1. Why cppcheck might be better:
    • Cppcheck is specifically designed for static analysis of C/C++ code
    • It typically provides more detailed error messages
    • It's also already enabled in your configuration

You can add this to your .coderabbit.yaml file. If you find that cppcheck also doesn't meet your needs, you can disable both tools:

reviews:
  tools:
    clang:
      enabled: false
    cppcheck:
      enabled: false

Try disabling just clang first and see if cppcheck's feedback is more helpful for your workflow.

@supervoidcoder
Copy link
Owner Author

supervoidcoder commented Jan 4, 2026

@coderabbitai no silly I meant the yml GitHub ACCTION

Repository owner deleted a comment from coderabbitai bot Jan 4, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

Tip

For best results, initiate chat on the files or code changes.

@supervoidcoder Ah my apologies! 😅 You're asking about a GitHub Actions workflow for clang linting! Here are a couple of options:

Option 1: clang-format (for formatting checks)

This won't fail the workflow but will leave comments:

name: C++ Linting

on: [pull_request]

jobs:
  clang-format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Run clang-format
        uses: jidicula/clang-format-action@v4.11.0
        with:
          clang-format-version: '17'
          check-path: '.'
          fallback-style: 'Google'
        continue-on-error: true  # Won't fail the workflow

Option 2: clang-tidy (for static analysis with better feedback)

This provides more detailed diagnostic messages:

name: C++ Linting

on: [pull_request]

jobs:
  clang-tidy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install clang-tidy
        run: |
          sudo apt-get update
          sudo apt-get install -y clang-tidy
      
      - name: Run clang-tidy
        run: |
          clang-tidy src/**/*.cpp -- -std=c++17 || true  # || true prevents failure
        continue-on-error: true

Option 3: Combined with reviewdog (best feedback)

This posts inline comments like ESLint does:

name: C++ Linting

on: [pull_request]

jobs:
  clang-tidy-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: clang-tidy review
        uses: ZedThree/clang-tidy-review@v0.16.2
        with:
          build_dir: .
          config_file: ''
        continue-on-error: true
        
      - name: Upload review comments
        uses: ZedThree/clang-tidy-review/upload@v0.16.2
        continue-on-error: true

I'd recommend Option 3 since it gives you inline PR comments similar to ESLint. The continue-on-error: true ensures it won't block your PRs!

🐰

@supervoidcoder supervoidcoder merged commit f7a8936 into main Jan 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments